/*
 * $Id$
 *
 * Copyright ( c ) 2014 XuNuo Corporation. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of XuNuo
 * Corporation ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with the terms
 * of the license agreement you entered into with XuNuo Corporation or a XuNuo
 * authorized reseller (the "License Agreement"). XuNuo may make changes to the
 * Confidential Information from time to time. Such Confidential Information may
 * contain errors.
 *
 * EXCEPT AS EXPLICITLY SET FORTH IN THE LICENSE AGREEMENT, XuNuo DISCLAIMS ALL
 * WARRANTIES, COVENANTS, REPRESENTATIONS, INDEMNITIES, AND GUARANTEES WITH
 * RESPECT TO SOFTWARE AND DOCUMENTATION, WHETHER EXPRESS OR IMPLIED, WRITTEN OR
 * ORAL, STATUTORY OR OTHERWISE INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A
 * PARTICULAR PURPOSE. XuNuo DOES NOT WARRANT THAT END USER'S USE OF THE
 * SOFTWARE WILL BE UNINTERRUPTED, ERROR FREE OR SECURE.
 *
 * XuNuo SHALL NOT BE LIABLE TO END USER, OR ANY OTHER PERSON, CORPORATION OR
 * ENTITY FOR INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL
 * DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR USE, WHETHER IN AN
 * ACTION IN CONTRACT, TORT OR OTHERWISE, EVEN IF XuNuo HAS BEEN ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES. XuNuo' TOTAL LIABILITY TO END USER SHALL NOT
 * EXCEED THE AMOUNTS PAID FOR THE XuNuo SOFTWARE BY END USER DURING THE PRIOR
 * TWELVE (12) MONTHS FROM THE DATE IN WHICH THE CLAIM AROSE.  BECAUSE SOME
 * STATES OR JURISDICTIONS DO NOT ALLOW LIMITATION OR EXCLUSION OF CONSEQUENTIAL
 * OR INCIDENTAL DAMAGES, THE ABOVE LIMITATION MAY NOT APPLY TO END USER.
 *
 * Copyright version 2.0
 */
package com.th.supcom.pds.phamapply.client.widget.phamapplydetail;

import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.SpinnerField;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.NumberFormat;
import com.th.supcom.pds.common.client.commom.PdsClientDateUtils;

/**
 * 药品请领组件集合
 * 
 * @author 杨冲
 */
public class PhamApplyFields
{

    /** 摆药天数 */
    private SpinnerField m_dispenseDays;
    /** 摆药截止时间 */
    private DateField m_disepenseEndTime;
    /** 医嘱长临标识Group */
    private CheckBoxGroup m_repetitionBoxGroup;
    /** 长期医嘱 */
    private CheckBox m_longBox;
    /** 临时医嘱 */
    private CheckBox m_tempBox;

    /**
     * 构造函数
     */
    public PhamApplyFields ()
    {
        createFields ();
    }

    /**
     * 创建组件
     */
    private void createFields ()
    {
        m_dispenseDays = new SpinnerField ();
        m_dispenseDays.setFieldLabel ("摆药天数");
        m_dispenseDays.setIncrement (1);
        m_dispenseDays.getPropertyEditor ().setType (Integer.class);
        m_dispenseDays.setFormat (NumberFormat.getFormat ("0"));
        m_dispenseDays.setMinValue (1);
        m_dispenseDays.setEditable (false);

        m_disepenseEndTime = new DateField ();
        m_disepenseEndTime.setFieldLabel ("截止时间");
        m_disepenseEndTime.setEnabled (false);
        m_disepenseEndTime.getPropertyEditor ().setFormat (DateTimeFormat.getFormat (PdsClientDateUtils.DATE_FORMAT_YYYY_MM_DD));

        m_repetitionBoxGroup = new CheckBoxGroup ();
        m_repetitionBoxGroup.setFieldLabel ("医嘱长临");

        m_longBox = new CheckBox ();
        m_longBox.setBoxLabel ("长期");
        m_repetitionBoxGroup.add (m_longBox);

        m_tempBox = new CheckBox ();
        m_tempBox.setBoxLabel ("临时");
        m_repetitionBoxGroup.add (m_tempBox);
    }

    /**
     * 获取摆药天数组件
     * 
     * @return
     */
    public SpinnerField getDispenseDays ()
    {

        return m_dispenseDays;
    }

    /**
     * 获取摆药截止时间
     * 
     * @return
     */
    public DateField getDisepenseEndTime ()
    {

        return m_disepenseEndTime;
    }

    /**
     * 获取医嘱长临标识ComboBox
     * 
     * @return DictComboBox
     */
    public CheckBoxGroup getRepetitionBoxGroup ()
    {

        return m_repetitionBoxGroup;
    }

    /**
     * 获取长期标识Box
     * 
     * @return
     */
    public CheckBox getLongBox ()
    {
        return m_longBox;
    }

    /**
     * 获取临时标识Box
     * 
     * @return
     */
    public CheckBox getTempBox ()
    {
        return m_tempBox;
    }
}
